<template>
    <TopNavBar title="收益详情" type="back" />
  <div class="order-detail-table">
    <div class="table-header">
      <div class="cell name">名称</div>
      <div class="cell">数量</div>
      <div class="cell buy">买入</div>
      <div class="cell sell">卖出</div>
      <div class="cell profit">总盈亏</div>
    </div>
    <div class="table-row" v-for="item in tableData" :key="item.name">
      <div class="cell name">{{ item.name }}</div>
      <div class="cell">{{ item.amount }}</div>
      <div class="cell buy">{{ item.buy }}</div>
      <div class="cell sell">{{ item.sell }}</div>
      <div class="cell profit">{{ item.profit }}</div>
    </div>
  </div>
</template>

<script setup>
const tableData = [
  { name: 'CL', amount: 24, buy: '67.25768', sell: '67.3', profit: '+0.62917' },
  { name: 'OIL', amount: 24, buy: '69.27631', sell: '69.33', profit: '+0.775' },
  { name: 'GLS', amount: 24, buy: '698.80122', sell: '698.275', profit: '+0.75417' },
  { name: 'GASO', amount: 24, buy: '2.11872', sell: '2.117', profit: '+0.8125' },
  { name: 'DBI', amount: 24, buy: '68.14063', sell: '68.093', profit: '+0.7' },
  { name: 'QG', amount: 24, buy: '3.5467', sell: '3.544', profit: '+0.7625' },
  { name: 'OIL', amount: 24, buy: '68.92629', sell: '68.98', profit: '+0.77917' },
  { name: 'GLS', amount: 24, buy: '698.51372', sell: '697.95', profit: '+0.80833' },
  { name: 'GLS', amount: 24, buy: '697.45597', sell: '697.95', profit: '+0.70833' },
  { name: 'QG', amount: 24, buy: '3.57248', sell: '3.575', profit: '+0.70417' },
]
</script>

<style scoped>
.order-detail-table {
  background: #fff;
  margin: 5px 0 0 0;
  padding: 10px 0 18px 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.table-header, .table-row {
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 2.2;
  padding: 0 10px;
}
.table-header {
  font-weight: 700;
  color: #222;
  border-bottom: 1px solid #eee;
  background: #fafbfc;
}
.table-row {
  font-weight: 400;
  color: #222;
  border-bottom: 1px solid #f5f5f5;
}
.cell {
  flex: 1;
  text-align: center;
  font-size: 13px;
  padding: 2px 0;
}
.cell.name {
  flex: 1.2;
}
.cell.buy {
  color: #0bb07b;
}
.cell.sell {
  color: #f55;
}
.cell.profit {
  color: #0bb07b;
}
</style> 